//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { UserHasGroup, UserHasGroupResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooUserHasGroupList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<UserHasGroupResponse>(`/uctoo/user_has_group/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooUserHasGroup = async (id: string) => {
  return requestClient.get<UserHasGroup>(`/uctoo/user_has_group/${id}`);
};

export const adductooUserHasGroup = async (data: Partial<UserHasGroup>) => {
  return requestClient.post<UserHasGroup>('/uctoo/user_has_group/add', data);
};

export const edituctooUserHasGroup = async (data: Partial<UserHasGroup>) => {
  return requestClient.post<UserHasGroup>('/uctoo/user_has_group/edit', data);
};

export const deleteuctooUserHasGroup = async (id: string) => {
  return requestClient.post<any>('/uctoo/user_has_group/del', { id });
};
